class c4_View

A collection of data rows.

Public:

c4_View (c4_Sequence* implementation_ =0);
Constructs a view based on a sequence.
c4_View (const c4_Property& property_);
Constructs an empty view with one property.
c4_View (const c4_View& view_);
Constructs a view from another one.
~c4_View ();

c4_View& operator= (const c4_View& source_);
Makes this view the same as another one.
int GetSize () const;
Returns the number of entries.
int GetUpperBound () const;
Returns highest index (size - 1).
void SetSize (int newSize_, int growBy_ =-1);
Changes the size of this view.
void RemoveAll ();
Removes all entries (sets size to zero).
c4_RowRef GetAt (int index_) const;
Returns a reference to specified entry.
c4_RowRef operator[] (int index_) const;
Shorthand for c4_View::GetAt.
void SetAt (int index_, c4_RowRef row_);
Changes the value of the specified entry.
c4_RowRef ElementAt (int index_);
Element access, for use as RHS or LHS.
void SetAtGrow (int index_, c4_RowRef row_);
Sets an entry, growing the view if needed.
int Add (c4_RowRef row_);
Adds a new entry at the end.
void InsertAt (int index_, c4_RowRef row_, int count_ =1);
Inserts one or more copies of an entry.
void RemoveAt (int index_, int count_ =1);
Removes entries starting at the given index.
void InsertAt (int index_, const c4_View& view_);
Inserts a copy of the contents of another view.
int NumProperties () const;
Returns the number of properties.
int NthProperty (int column_) const;
Returns the id of the N-th property.
int FindProperty (int id_);
Finds the index of a property, given its id.
c4_View Structure () const;
Returns a view which describes the structure of this view.
c4_String Describe () const;
Returns a description of the structure.
static c4_String Description (const c4_View& view_);
Returns a homogenized description of this view.
c4_View Clone () const;
Constructs a new view with the same structure but no data.
void AddProperty (const c4_Property& property_);
Adds a property column to a view if not already present.
c4_View operator;

c4_View const;

c4_View operator, (const c4_Property& property_) const;
Returns a view like the first, with a property appended to it.
c4_View Sort () const;
Creates view with all rows in natural (property-wise) order.
c4_View SortOn (const c4_View& order_) const;
Creates view sorted according to the specified properties.
c4_View SortOnReverse (const c4_View& order_, const c4_View& orderDown_) const;
Creates sorted view, with some properties sorted in reverse.
c4_View Select (c4_RowRef criterium_) const;
Creates a view with rows matching the specified value.
c4_View SelectRange (c4_RowRef rowLow_, c4_RowRef rowHigh_) const;
Creates a view with row values within the specified range.
c4_View Project (const c4_View& order_) const;
Creates a view with the specified property arrangement.
c4_View ProjectWithout (const c4_View& order_) const;
Creates a derived view with some properties omitted.
int GetIndexOf (c4_RowRef row_) const;
Returns the index of the specified row in this view (or -1).
int Find (c4_RowRef key_, int start_ =0) const;
Finds index of the the next entry matching the specified key.
int Search (c4_RowRef key_) const;
Searches for a key, using the native sort order of the view.
Protected:

void _IncSeqRef ();

void _DecSeqRef ();

Friends:

friend class c4_ViewRef;



#include "k4view.h"   // Jun 8, 1997